import { get, post } from '@/utils/request'
import type { FoodParamType, FoodInstanceInterface } from '@/types/views/food'

// query all list
export const queryFoodList = (param: { keyword: string }) => {
    return get<FoodInstanceInterface[]>('/food/query', param)
}

// add item
export const insertFood = (param: FoodParamType) => {
    return post('/food/add', param)
}

// update item
export const updateFood = (param: FoodParamType) => {
    return post('/food/update', param)
}

// delete item
export const deleteFood = (param: { id: FoodInstanceInterface['id'] }) => {
    return get('/food/delete', param)
}
